﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SelectVote.aspx.cs" Inherits="Meeting.Web.Admin.SelectBase.SelectVote" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../../Css/SmartWizard/smart_wizard.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../Scripts/jquery-1.8.2.min.js"></script>
    <!--ardialog-->
    <script type="text/javascript" src="../../Scripts/artDialog4.1.6/artDialog.js?skin=blue"></script>
    <script type="text/javascript" src="../../Scripts/artDialog4.1.6/plugins/iframeTools.js"></script>
    <link href="../../Css/main.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="../../Scripts/themes/cupertino/easyui.css" />
    <link rel="stylesheet" type="text/css" href="../../Scripts/themes/icon.css" />
    <script type="text/javascript" src="../../Scripts/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../../Scripts/locale/easyui-lang-zh_CN.js"></script>
    <script src="../../Scripts/datagrid-detailview.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../Scripts/common.js"></script>
    <script src="../../Scripts/Json2.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            art.dialog.removeData('result');
            $("#voteUse").datagrid({
                url: '../MeetingPre/MeetingOperation.ashx?method=GetVote&Id=',
                pagination: true,
                pageSize: 5,
                pageNumber: 1 //默认索引页 
            });
            //设置分页
            var p = $("#voteUse").datagrid("getPager");
            $(p).pagination({
                //每页显示的记录条数，默认为10   
                pageList: [5, 10, 15], //可以设置每页记录条数的列表   
                beforePageText: '第', //页数文本框前显示的汉字   
                afterPageText: '页    共 {pages} 页',
                displayMsg: '当前显示 {from} - {to} 条记录   共 {total} 条记录'

            });
        }); 
        var selJson = "";
        function GetSelectVote() {
            var rows = $("#voteUse").datagrid("getSelections");
            var row;
            for (i = 0; i < rows.length; i++) {
               
                row = rows[i];
                selJson += ',' + '{"VoteId":"' + row.Id + '","Theme":"' + row.Theme + '"}';
            }
           
        }

        function SelectOk() {
            GetSelectVote();
            if (selJson.length > 0) selJson = selJson.substring(1);
            selJson = "[" + selJson + "]";
            //提交 
            art.dialog.data('result', "true");
            art.dialog.data('selJson', selJson);
            art.dialog.close();
        }
        function DoSearch() {
            var name = $("#fName").val();
            $("#voteUse").datagrid("reload", { Theme: name });
         
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table>
            <tr>
                <td>
                    投票名称:
                </td>
                <td>
                    <input id="fName" style="width: 120px;" class="easyui-validatebox" />
                </td>
                <td>
                    <a href="#" class="easyui-linkbutton" onclick="DoSearch();">查询</a>
                </td>
            </tr>
        </table>
        <table id="voteUse" style="width: 550px; height: 260px;"  fitcolumns="true">
            <thead>
                <tr>
                    <th data-options="field:'Id',width:80,hidden:true">
                        投票编号
                    </th>
                    <th data-options="field:'Theme',width:80">
                        投票主题
                    </th>
                    <th data-options="field:'chk',checkbox:true">
                    </th>
                </tr>
            </thead>
        </table>
    </div>
    <div style="clear: both; text-align: right; margin-top: 15px;">
        <a id="A1" class="easyui-linkbutton" onclick="SelectOk();">确定</a>
    </div>
    </form>
</body>
</html>
